import React from 'react';
import 'element-theme-default';
import {Upload,Input,Select,Layout,DatePicker,TimePicker,Switch,Checkbox,Radio,Button} from 'element-react';
export default class User extends React.Component{
    constructor(props) {
        super(props);
    }
      
    render(){
      const fileList2 = [
        {name: 'food.jpeg', url: '库\图片\react-project.PNG'}
      ]
        return(
            <div className="container">
              <Upload
                className="upload-demo"
                action="http://10.31.153.45:3000/news/data"
                onPreview={file => this.handlePreview(file)}
                onRemove={(file, fileList) => this.handleRemove(file, fileList)}
                fileList={fileList2}
                listType="picture"
                tip={<div className="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>}
                 >
                <Button size="small" type="primary">点击上传</Button>
              </Upload>
             </div>
        )
    }

    handleRemove(file, fileList) {
      console.log(1111)
    }
    
    handlePreview(file) {
      console.log(222)
      
    }
    
}

